﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LogicUniversityBiz;

namespace LogicUniversity.clerks
{
    public partial class StationeryStatusReport : System.Web.UI.Page
    {
        protected void Page_PreInit(Object sender, EventArgs e)
        {
            //(Session["Role"]
            if (Session["Role"] as string != "Clerk")
            {
                Response.Redirect("~/Login.aspx");
            }

        }

        private CoreClerkFascade fs = new CoreClerkFascade();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblDate.Text = System.DateTime.Today.ToShortDateString();
                fillGrid();
            }
        }

        private void fillGrid()
        {
            StatusView.DataSource = fs.getCatelogueItemsUnderReorderLevel();
            StatusView.DataBind();
        }

        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            try
            {
                ClientScript.RegisterStartupScript(GetType(), "openwindow", "<script type=text/javascript>window.print();</script>");
            }
            catch (Exception ex)
            {

            }
        }
    }
}